import { createApp } from 'vue'
import App from './App.vue'
import 'element-plus/es/components/message/style/css'
import { registerCertificate } from '@shared/clientMessage'
import { Certificate } from '@shared/types'

registerCertificate(Certificate.CONTENT)

const app = createApp(App)

app.mount(import.meta.env.DEV ? '#app' : initializeId())

function initializeId() {
  const id = `#swagger-to-dts--manifest3`

  if (!document.querySelector(id)) {
    document.body.insertAdjacentHTML('beforeend', `<div id="${id.slice(1)}"></div>`)
  }

  return id
}
